var path = require("path");
var webpack = require("webpack");
module.exports = {
  entry: "./main.js",
  output: {
      path: path.join(__dirname,'dist'),
      publicPath: '/dist/',
      filename: 'bundle.js'
  },
  module: {
      rules: [
          {
              test: /.vue$/,
              use: {
                  loader: 'vue-loader'
                  }
          },
          {
              test: /.js$/,
              exclude: /node_modules/,
              use: {
                  loader: 'babel-loader'
              }
          },
          {
              test: /.css/,
              use: {
                  loader:'style-loader!css-loader'
              }

          }
      ]
  },
  devServer: {
      inline: true,
      historyApiFallback: true//当设置为true时，访问所有服务器上不存在的文件，都会被重定向到/，也就是index.html文件
  },
  resolve: {
      alias: {
          'vue': 'vue/dist/vue.js'
      }
  }
}